package cn.iocoder.yudao.module.call.dal.mysql.ivrknowledgegroup;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.call.dal.dataobject.ivrknowledgegroup.IvrKnowledgeGroupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.call.controller.admin.ivrknowledgegroup.vo.*;

/**
 * ivr-知识库组 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface IvrKnowledgeGroupMapper extends BaseMapperX<IvrKnowledgeGroupDO> {

    default PageResult<IvrKnowledgeGroupDO> selectPage(IvrKnowledgeGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IvrKnowledgeGroupDO>()
                .likeIfPresent(IvrKnowledgeGroupDO::getName, reqVO.getName())
                .eqIfPresent(IvrKnowledgeGroupDO::getFlowId, reqVO.getFlowId())
                .eqIfPresent(IvrKnowledgeGroupDO::getType, reqVO.getType())
                .betweenIfPresent(IvrKnowledgeGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IvrKnowledgeGroupDO::getId));
    }

}